<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderLogs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_logs', function (Blueprint $table) {
            $table->id();
            $table->integer('order_id')->default(0)->comment('订单ID');
            $table->tinyInteger('user_type')->default(1)->comment('操作人身份，1-后台，2供应商');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('log_name')->default('')->comment('操作名称');
            $table->string('url')->default('')->comment('操作地址');
            $table->text('data')->nullable()->comment('修改的数据');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_logs');
    }
}
